import request from "../../http";

// 企业空间 - 人才服务

// 获取用工需求信息
export function getRequirements(params) {
  return request({
    url: "/mine/companyhelp/requirement/list",
    method: "GET",
    params
  })
}

// 申请用工需求 
export function applyRequirement(data) {
  return request({
    url: "/mine/companyhelp/requirement/apply",
    method: "POST",
    data,
    isFormData: true
  })
}

// 删除用工需求 
export function deleteRequirement(data) {
  return request({
    url: "/mine/companyhelp/requirement/delete",
    method: "POST",
    data,
    isFormData: true
  })
}

// 已招用工需求
export function finishRequirement(data) {
  return request({
    url: "/mine/companyhelp/requirement/finish",
    method: "POST",
    data,
    isFormData: true
  })
}


// 获取学历要求下拉列表
export function getEducationSelectList() {
  return request({
    url: "/dttalent/library/educationList",
    method: "GET"
  })
}

// 获取我申请的简历
export function getMyApply(params) {
  return request({
    url: "/mine/companyhelp/requirement/worker/apply/list",
    method: "GET",
    params
  })
}

// 录用 Pass
export function Pass(data) {
  return request({
    url: "/mine/companyhelp/requirement/worker/apply/pass",
    method: "POST",
    data,
    isFormData: true
  })
}

// 拒绝 Reject
export function Reject(data) {
  return request({
    url: "/mine/companyhelp/requirement/worker/apply/reject",
    method: "POST",
    data,
    isFormData: true
  })
}

// 企业空间 - 我申请的简历
// 获取申请简历详情
export function getApplyResumeDetail(id) {
  return request({
    url: `/mine/companyhelp/requirement/worker/apply/detail/${id}`,
    method: "GET"
  })
}


// 企业空间 - 个人基本信息
// 获取应聘人员详情 
export function getWorker(id) {
  return request({
    url: `/mine/companyhelp/requirement/worker/detail/${id}`,
    method: "GET"
  })
}

// 企业空间 - 招聘需求申请页
// 获取地理信息树
export function getRegionTree() {
  return request({
    url: `/system/region/tree`,
    method: "GET"
  })
}

// 获取用工需求信息
export function getRequirement(id) {
  return request({
    url: `/mine/companyhelp/requirement/detail/${id}`,
    method: "GET"
  })
}

// 提交申请 - 添加
export function sendAdd(data) {
  return request({
    url: "/mine/companyhelp/requirement/add",
    method: "POST",
    data
  })
}

// 提交申请 - 修改
export function sendEdit(data) {
  return request({
    url: "/mine/companyhelp/requirement/edit",
    method: "POST",
    data
  })
}
